package com.csdn.listener;

import org.eclipse.jetty.server.Server;
import org.eclipse.jetty.server.handler.HandlerCollection;
import org.eclipse.jetty.server.handler.StatisticsHandler;

public class CustomEventA {
    public static void main(String[] args) throws Exception {
        // 创建服务器
        Server server = new Server(9001);



        HandlerCollection handlerCollection = new HandlerCollection();
        StatisticsHandler statisticsHandler = new StatisticsHandler();
        statisticsHandler.setServer(server);
        handlerCollection.addHandler(statisticsHandler);
        // 设置handler
        server.setHandler(handlerCollection);
        // 启动应用服务并等待请求
        server.start();
        // 阻塞Jetty server的线程池，直到线程池停止
        server.join();

    }
}
